package ru.nagakhl.whirlpool;

import java.util.Map;

import org.apache.cassandra.thrift.ConsistencyLevel;

/**
 * Interface that objects storing class mapping metadata must implement.
 * 
 * @author user
 *
 */
public interface Metadata {

	/**
	 * Get keyspace name this class maps to
	 */
	public String getKeyspace();

	/**
	 * Get column (or supercolumn) family this class maps to
	 */
	public String getColumnFamily();

	/**
	 * Get value from class field, mapped as Id
	 * 
	 * @param obj Object to get value from
	 */
	public String getId(Object obj);

	/**
	 * Get byte representation of values of all mapped (not marked as transient) fields.
	 * 
	 * @param obj Object to get values from
	 */
	public Map<byte[], byte[]> getFields(Object obj);

	/**
	 * Get consistency level that should be used working with this class
	 * 
	 * @return ConsistencyLevel for this class or manager-wide level if it is not explicitly set for class
	 */
	public ConsistencyLevel getLevel();

	/**
	 * Checks if this class mapped to super column 
	 */
	public boolean isSuperColumn();

	/**
	 * Returns count of all mapped (not marked as transient) fields
	 */
	public int fieldCount();

}